import {Component, Input, OnInit} from '@angular/core';

@Component({
  selector: 'app-chart-line-data-point',
  templateUrl: './chart-line-data-point.component.html',
  styleUrls: ['./chart-line-data-point.component.css']
})
export class ChartLineDataPointComponent implements OnInit {

  constructor() { }

  public lineOption:object

  @Input() name:string;
  @Input() unit:string;
  @Input() sortId:string;
  @Input() parentId:string;
  // @Input() kkscode:string;
  @Input() target:string;

  ngOnInit() {
    this.lineOption={
      title: {
        text: this.name?this.name+'趋势图':'',
      },
      credits:{
        enabled:false
      },
      xAxis: {
      },
      yAxis: {
        title: {
          text: this.name?this.name+'('+this.unit+')':''
        },
        plotLines: [{
          value: 0,
          width: 1,
          color: '#808080'
        }]
      },
      tooltip: {
        valueSuffix: this.unit||''
      },
      legend: {
        enabled:false
      },
      series: [{
        name: this.name||'',
        data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
      }]
    }
  }

}
